//
//  ButtonCell.m
//  OCUI3
//
//  Created by login on 15-6-30.
//  Copyright (c) 2015年 login. All rights reserved.
//

#import "ButtonCell.h"

@interface ButtonCell ()
{
    UILabel *_labelTitle;
    UIButton *_button1;
    UIButton *_button2;
    UIButton *_button3;
    UIButton *_button4;
    UIButton *_button5;
    NSString *_labelString;
    UIColor *_mainColor;
}
@end

@implementation ButtonCell

- (void)addContentView
{
    _labelString = @"ssss";
    _mainColor = [UIColor redColor];
    
    CGFloat width = [UIScreen mainScreen].bounds.size.width;
    
    _labelTitle = [[UILabel alloc]initWithFrame:CGRectMake(5, 0, width-10, 20)];
    _labelTitle.text = _labelString;
    _labelTitle.textColor = _mainColor;
    _labelTitle.backgroundColor = [UIColor whiteColor];
    _labelTitle.textAlignment = NSTextAlignmentLeft;
    _labelTitle.font = [UIFont systemFontOfSize:20];
    [self addSubview:_labelTitle];

    _button1 = [[UIButton alloc]initWithFrame:CGRectMake(5, 20, (width-20)/3, 85)];
    _button1.backgroundColor = _mainColor;
    [self addSubview:_button1];
    
    _button2 = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_button1.frame)+5, 20, (width-20)/3, 40)];
    _button2.backgroundColor = _mainColor;
    [self addSubview:_button2];
    
    _button3 = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_button2.frame)+5, 20, width - CGRectGetMaxX(_button2.frame) - 5 - 5 , 40)];
    _button3.backgroundColor = _mainColor;
    [self addSubview:_button3];
    
    _button4 = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_button1.frame)+5, CGRectGetMaxY(_button2.frame)+5, (width-20)/3, 40)];
    _button4.backgroundColor = _mainColor;
    [self addSubview:_button4];
    
    _button5 = [[UIButton alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_button4.frame)+5, CGRectGetMaxY(_button2.frame)+5, width - CGRectGetMaxX(_button2.frame) - 5 - 5, 40)];
    _button5.backgroundColor = _mainColor;
    [self addSubview:_button5];
}

- (CGFloat)getCellHeight;
{
    CGFloat returnHeight = 0;
    returnHeight += 20;
    returnHeight += 40;
    returnHeight += 10;
    returnHeight += 40;
    
    return returnHeight;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
